package com.yunti.yntk;

import android.app.Application;
import android.content.res.AssetManager;
import android.util.Log;
import com.yunti.yntk.manager.*;

import com.yunti.yntk.service.WebServer;

public class MyApplication extends Application {

    private WebServer webServer;

    private static final int PORT = 8080;
    @Override
    public void onCreate() {
        super.onCreate();
        ConfigManager.getInstance().init(getApplicationContext());
        NetWorkManager.getInstance().init(getApplicationContext());
        TTSManager.getInstance().init(getApplicationContext());
        TotalStationManager.getInstance().init(getApplicationContext());
        ComputScoreManager.getInstance().init(getApplicationContext());
        DuManager.getInstance().init(getApplicationContext());
        amituofou();
        AssetManager assetManager = getAssets();
        webServer = new WebServer(assetManager, this, PORT);
        webServer.start();

    }

    public WebServer getWebServer() {
        return webServer;
    }

    public void setWebServer(WebServer webServer) {
        this.webServer = webServer;
    }

    void amituofou(){
        Log.e("阿弥陀佛", "" +
                "////////////////////////////////////////////////////////////////////  \n" +
                "//                          _ooOoo_                               //  \n" +
                "//                         o8888888o                              //  \n" +
                "//                         88\" . \"88                            //  \n" +
                "//                         (| ^_^ |)                              //  \n" +
                "//                         O\\  =  /O                             //  \n" +
                "//                      ____/`---'\\____                          //  \n" +
                "//                    .'  \\\\|     |//  `.                        //  \n" +
                "//                   /  \\\\|||  :  |||//  \\                      //  \n" +
                "//                  /  _||||| -:- |||||-  \\                       //  \n" +
                "//                  |   | \\\\\\  -  /// |   |                       //  \n" +
                "//                  | \\_|  ''\\---/''  |   |                       //  \n" +
                "//                  \\  .-\\__  `-`  ___/-. /                       //  \n" +
                "//                ___`. .'  /--.--\\  `. . ___                     //  \n" +
                "//              .\"\" '<  `.___\\_<|>_/___.'  >'\"\".                  //  \n" +
                "//            | | :  `- \\`.;`\\ _ /`;.`/ - ` : | |                 //  \n" +
                "//            \\  \\ `-.   \\_ __\\ /__ _/   .-` /  /                 //  \n" +
                "//      ========`-.____`-.___\\_____/___.-`____.-'========         //  \n" +
                "//                           `=---='                              //  \n" +
                "//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //  \n" +
                "//            佛祖保佑       永不宕机      永无BUG                　　//\n" +
                "////////////////////////////////////////////////////////////////////\n");
    }

}
